package org.springframework.core.annotation;

import java.lang.annotation.Annotation;

@FunctionalInterface
public interface AnnotationsProcessor<C, R> {

    default R doWithAggregate(C context,
                              int idx) {
        return null;
    }

    R doWithAnnotations(C context,
                        int aggregateIndex,
                        Object source,
                        Annotation[] annotations);

    default R finish(R result) {
        return result;
    }
}
